<!DOCTYPE html SYSTEM "http://www.thymeleaf.org/dtd/xhtml1-strict-thymeleaf-spring4-4.dtd">
<html lang="en" xmlns="http://www.w3.org/1999/xhtml"
      xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="utf-8">
    <title>基本设置</title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport"
          content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=0">
    <link rel="stylesheet" th:href="@{/static/commen/css/layui.css}" media="all">
    <link rel="stylesheet" th:href="@{../../static/back/css/admin.css}">
    <link th:href="@{/static/lib/layui_exts/cropper/cropper.css}" rel="stylesheet"/>
</head>
<body>
<div class="layui-fluid">
    <div class="layui-col-md12">
        <div class="layui-navs">
					<span class="layui-breadcrumb" lay-separator="—">
						<a href="javascript:;">系统设置</a>
						<a href="javascript:;">网站设置</a>
						<a><cite>基本设置</cite></a>
					</span>
            <a class="layui-btn layui-btn-small" style="line-height:1.6em;float:right;height: 36px;"
               href="javascript:location.replace(location.href);" title="刷新">
                <i class="layui-icon layui-icon-refresh" style="line-height:36px;font-size: 16px;"></i>
            </a>
        </div>
    </div>
    <div class="layui-col-md12">
        <form class="layui-form layui-form-pane" action="" id="frm-reg">
            <div class="layui-card">
                <div class="layui-tab layui-tab-brief" lay-filter="docDemoTabBrief">
                    <ul class="layui-tab-title">
                        <li class="layui-this">基本设置</li>
                        <li>安全设置</li>
                    </ul>
                    <div class="layui-tab-content" style="height: 100%;">
                        <div class="layui-tab-item layui-show">
                            <div class="layui-form-item">
                                <label class="layui-form-label">网站名称</label>
                                <div class="layui-input-block">
                                    <input type="text" name="website_name" id="website_name" value="" autocomplete="off"
                                           placeholder="控制在25个字、50个字节以内" class="layui-input">
                                </div>
                            </div>
                            <div class="layui-form-item">
                                <label class="layui-form-label">关键词</label>
                                <div class="layui-input-block">
                                    <input type="text" name="website_keyword" id="website_keyword" value=""
                                           autocomplete="off" placeholder="5个左右,8汉字以内,用英文,隔开" class="layui-input">
                                </div>
                            </div>
                            <div class="layui-form-item">
                                <label class="layui-form-label">描述</label>
                                <div class="layui-input-block">
                                    <input type="text" name="website_describe" id="website_describe" value=""
                                           autocomplete="off" placeholder="制在80个汉字，160个字符以内" class="layui-input">
                                </div>
                            </div>
                            <div class="layui-form-item">
                                <label class="layui-form-label">网站LOGO</label>
                                <div class="layui-input-inline">
                                    <input type="text" class="layui-input" name="website_logo" id="website_logo"
                                           value="">
                                </div>
                                <div class="layui-form-mid layui-word-aux">
                                    <button type="button" class="layui-btn" data-name="website_logo" data-place="system"
                                            style="margin-top: -8px;" id="productImgButton">上传图片
                                    </button>
                                </div>
                            </div>
                            <div class="layui-form-item">
                                <div class="layui-input-block">
                                    <img id="images_url" src="http://images.nowcoder.com/head/746t.png"
                                         style="width: 150px;height: 50px;border: 1px solid #cccccc;border-radius: 5px;">
                                </div>
                            </div>
                            <div class="layui-form-item">
                                <label class="layui-form-label">底部版权</label>
                                <div class="layui-input-block">
                                    <input type="text" name="website_copyright" id="website_copyright" value=""
                                           autocomplete="off" placeholder="&copy; 2019 xxx.xxx" class="layui-input">
                                </div>
                            </div>
                            <div class="layui-form-item">
                                <label class="layui-form-label">备案号</label>
                                <div class="layui-input-block">
                                    <input type="text" name="website_recordno" id="website_recordno" value=""
                                           autocomplete="off" placeholder="京ICP备00000000号" class="layui-input">
                                </div>
                            </div>
                            <div class="layui-form-item" pane="">
                                <label class="layui-form-label">网站开关</label>
                                <div class="layui-input-block">
                                    <input type="checkbox" checked="checked" name="status" id="status" lay-skin="switch"
                                           lay-filter="switchTest" title="开关" lay-text="开|关">
                                </div>
                            </div>
                            <div class="layui-form-item layui-form-text">
                                <label class="layui-form-label">关闭原因</label>
                                <div class="layui-input-block">
                                    <textarea placeholder="网站关闭原因" class="layui-textarea" name="close_reason"
                                              id="close_reason"></textarea>
                                </div>
                            </div>
                        </div>
                        <div class="layui-tab-item">
                            <div class="layui-form-item layui-form-text">
                                <label class="layui-form-label">允许访问后台的IP列表</label>
                                <div class="layui-input-block">
                                    <textarea placeholder="允许访问后台的IP列表,多个用英文,隔开" class="layui-textarea" name="ip_list"
                                              id="ip_list"></textarea>
                                </div>
                            </div>
                            <div class="layui-form-item">
                                <label class="layui-form-label">失败次数</label>
                                <div class="layui-input-block">
                                    <input type="number" min="0" max="100" name="ip_number" id="ip_number" value="0"
                                           autocomplete="off" placeholder="后台登录失败最大次数" class="layui-input">
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
            <div class="layui-form-item" style="margin-left: 50px;">
                <input type="hidden" name="request_url" id="request_url" value="{:url('SystemBasic/operation')}">
                <button class="layui-btn" id="execute" lay-submit="execute" lay-filter="execute"><i
                        class="layui-icon layui-icon-form"></i>保存
                </button>
            </div>
        </form>
    </div>
</div>
</body>
</html>
<script th:src="@{../../static/back/js/jquery-3.4.1.min.js}"></script>
<script th:src="@{/static/commen/layui.js}"></script>
<link th:href="@{/static/lib/layui_exts/cropper/cropper.css}" rel="stylesheet"/>
<script th:src="@{/static/lib/layui_exts/cropper/croppers.js}"></script>
<script th:src="@{../../static/back/js/admin.js}"></script>
<script>
    layui.config({
        base: '/static/lib/layui_exts/cropper/' //layui自定义layui组件目录
    }).use(['form', 'croppers'], function () {
        var $ = layui.jquery
            , form = layui.form
            , croppers = layui.croppers
            , layer = layui.layer;
        //创建一个头像上传组件
        croppers.render({
            elem: '#productImgButton'
            , saveW: 150     //保存宽度
            , saveH: 150
            , mark: 1 / 1    //选取比例
            , area: '900px'  //弹窗宽度
            , url: "/common/upload?type=plate"  //图片上传接口返回和（layui 的upload 模块）返回的JOSN一样
            , done: function (path) { //上传完毕回调
                $("#website_logo").val(path);
                $("#images_url").attr('src', path);
            }
        });

    });
</script>